MIPS: make cache operation mode configurable
authorDaniel Schwierzeck <[email protected]>
Wed, 27 Jul 2011 11:22:38 +0000 (13:22 +0200)
committerShinya Kuribayashi <[email protected]>
Sun, 31 Jul 2011 14:26:41 +0000 (23:26 +0900)
Currently the cache operation mode is hard-coded to
CONF_CM_CACHABLE_NONCOHERENT. This is not appropiate for CPUs or SOCs
which operate at a different mode.

This patch makes the cache operation mode configurable via board config.

Signed-off-by: Daniel Schwierzeck <[email protected]>
Acked-by: Thomas Langer <[email protected]>
Signed-off-by: Shinya Kuribayashi <[email protected]>
arch/mips/cpu/mips32/start.S

index e829b024c728fa4d4d3be7a973967b0ace846929..9c1b2f76d09bcff61c4d617da0795b7f35b9085c 100644 (file)
 #include <asm/regdef.h>
 #include <asm/mipsregs.h>
 
+#ifndef CONFIG_SYS_MIPS_CACHE_MODE
+#define CONFIG_SYS_MIPS_CACHE_MODE CONF_CM_CACHABLE_NONCOHERENT
+#endif
+
        /*
         * For the moment disable interrupts, mark the kernel mode and
         * set ST0_KX so that the CPU does not spit fire when using
@@ -249,7 +253,7 @@ reset:
         nop
 
        /* ... and enable them */
-       li      t0, CONF_CM_CACHABLE_NONCOHERENT
+       li      t0, CONFIG_SYS_MIPS_CACHE_MODE
        mtc0    t0, CP0_CONFIG
 #endif